package cn.tedu.review;

/**
 * @author: Dsi
 * @date: 2021/11/9 9:10
 * @description:该类用于回顾构造函数
 */
public class TestContround {
    public static void main(String[] args) {
        Car c=new Car();
        Car c1=new Car(10);
        Car c2=new Car("路飞",4399,1);
        BWM b=new BWM();

    }
}
class Car{
    {}
    String brand;
    double price;
    int carAge;
    public Car(){
        System.out.println("我是无参构造");
    }
    public Car(int a){
        System.out.println("我是含参构造"+a);
    }

    public Car(String brand, double price, int carAge) {
        this.brand = brand;
        this.price = price;
        this.carAge = carAge;
        System.out.println("我是全参构造"+price);

    }
}
class BWM{

}